<%--
  Created by IntelliJ IDEA.
  User: 17445
  Date: 2022/8/23
  Time: 10:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
  <meta charset="UTF-8">
  <title>商品列表</title>
  <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/admin/car/css/boss.css"/>
  <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/admin/car/css/font-awesome.css"/>
  <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/admin/car/css/style.css"/>
</head>
<body>
<div class="main_box">
  <h2><span></span>商品列表</h2>
  <div class="cont_box">
    <table border="0" cellspacing="0" cellpadding="0" class="table" id="table_box">
      <thead>
      <tr>
        <th>商品名称</th>
        <th>所属分类</th>
        <th>价格</th>
        <th>库存</th>
        <th>状态</th>
        <th>添加时间</th>
        <th width="268">操作</th>
      </tr>
      </thead>
      <tbody>
      <c:forEach items="${list}" var="s">
      <tr><!--此处id为进行编辑或删除时该条数据的唯一标识-->
        <td>${s.j_letem_name}</td>
        <td>${s.commoditya.j_commodity_classification_name}</td>
        <td>${s.j_price}</td>
        <td>${s.j_stock}</td>
        <td>
        <c:if test="${s.j_state==0}">
          <a href="${pageContext.request.contextPath}/CommodityController/updatestate?J_letem_id=${s.j_letem_id}&J_state=${s.j_state}" class="table_btn table_grey down_shelf" >
            <i class="fa fa-arrow-down"></i>
            <span>下架</span>
          </a>
        </c:if>
        <c:if test="${s.j_state==1}">
          <a href="${pageContext.request.contextPath}/CommodityController/updatestate?J_letem_id=${s.j_letem_id}&J_state=${s.j_state}" class="table_btn table_warning up_shelf" >
            <i class="fa fa-arrow-up"></i>
            <span>上架</span>
          </a>
        </c:if>
        </td>
        <td>2017-03-06</td>
        <td>
          <a href="${pageContext.request.contextPath}/CommodityController/findByid?J_letem_id=${s.j_letem_id}" class="table_btn table_edit edit_btn">
          <i class="fa fa-edit"></i>
          <span>编辑</span>
          </a>
          <a href="${pageContext.request.contextPath}/CommodityController/deleteCommodity?J_letem_id=${s.j_letem_id}" class="table_btn table_del del_btn">
            <i class="fa fa-trash-o"></i>
            <span>删除</span>
          </a>
        </td>
      </tr>
      </c:forEach>
      </tbody>
    </table>
  </div>
</div>
<!--javascript include-->
<script src="js/jquery-2.2.1.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/other.js"></script>
<script>
  $(function(){
    $("body").other({tableId:"#table_box",tableWrap:[0,1,6],tableAas:[ 5,"desc"],tableSearch:true});
    $("body").tipWindow({method:"delete",Class:".del_btn",even:"click",Twidth:"400",Theight:"180",delUrl:"#"});//delUrl 删除请求地址
    $("body").tipWindow({method:"edit",type:"form",Class:".edit_btn",even:"click",tipTit:"商品编辑",Twidth:"700",Theight:"600",editUrl:"#"});//editUrl 编辑请求地址
    $("body").tipWindow({method:"Shelf",Twidth:"400",Theight:"180",shelfUrl:"#"});//shelfUrl 上下架请求地址
  });
</script>
</body>
</html>
